package com.mic.yzzn.plc.common.control.datastructure;

import java.io.Serializable;

/**
 * Created by ASH on 16/4/9.
 * <p>
 * 用于对 Collector 进行控制的数据结构
 */
public class PLCCollectorControlCmd implements Serializable {

    public static final int PLCCollectorControlCmdResultSuccess = 0,
            PLCCollectorControlCmdResultFail = 1,
            PLCCollectorControlCmdResultWrongID = 2,
            PLCCollectorControlCmdResultUnsuitCmd = 3, // 无法在一个采集器处于Stop状态下发送除了PLCCmdTypeReboot之外的其他指令
            PLCCollectorControlCmdResultUnnecessary = 4; // 当采集器的状态和指令类型是一样的时返回该结果

    public static final int PLCCmdTypeActivation = 0, //启动，继续执行
            PLCCmdTypeSleep = 1, // 暂停，可以再启动执行
            PLCCmdTypeStop = 2, // 销毁，从map中清除
            PLCCmdTypeReboot = 3;

    /**
     * 目标采集器的ID
     */
    private String targetID;
    /**
     * 指令的类型
     */
    private int type;
    /**
     * 指令的延迟
     */
    private int delay;

    private PLCCollectorControlCmd() {

    }

    public PLCCollectorControlCmd(String targetID, int type, int delay) {
        this.targetID = targetID;
        this.type = type;
        this.delay = delay;
    }

    // Getter
    public int getDelay() {
        return delay;
    }

    public int getType() {
        return type;
    }

    public String getTargetID() {
        return targetID;
    }
}
